﻿<%@ Page Language="C#" %>

<%@ Import Namespace="wojilu" %>
<%@ Import Namespace="wojilu.View" %>
<%@ Import Namespace="wojilu.Web.Controller" %>
<%@ Import Namespace="wojilu.Apps.Qycms.Domain" %>
<%var site = v.data("site") as m_site; %>
<%var lngs = site.lngs; %>
<%var dlngs = site.dlngs; %>
<%var read = v.data("read") as System.Data.DataRow; %>

<!DOCTYPE html>
<html lang="pla">
<head>
	<meta charset="utf-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=0" />
	<title>#{pageTitle}</title>
    <meta name="Keywords" content="#{pageKeywords}" />
    <meta name="description" content="#{pageDescription}" />
	<link rel="stylesheet" href="#{site.templates}css/style.css" type="text/css" media="all" />

	<script src="#{site.templates}js/jquery-1.8.0.min.js" type="text/javascript"></script>
	<script src="#{site.templates}js/jquery.touchwipe.1.1.1.js" type="text/javascript"></script>
	<script src="#{site.templates}js/jquery.carouFredSel-5.5.0-packed.js" type="text/javascript"></script>
	<script src="#{site.templates}js/functions.js" type="text/javascript"></script>
</head>
<body>
	<!-- wrapper -->
	<div class="wrapper">
		<!-- header -->
		#{top}
		<!-- end of header -->		
        <!-- shell -->
		<div class="shell">
			<!-- main -->
			<div class="main">
				<section class="post1">
								<ul>
								<li><span>#{site.position}:</span>
								<a href="#{site.dir}">#{site.hometitle}</a>&nbsp;&gt;&gt;&nbsp;#{daohang} > <span> > </span>正文</li>
								</ul>
				</section>
				<section class="post2">
					<div class="post1-cnt">
						<h2>联系我们</h2>
							<%=read["content"] %>
					</div>
					<meta content="text/html";> 
					<style type="text/css">
					    html, body {
					        margin: 0;
					        padding: 0;
					    }

					    .iw_poi_title {
					        color: #CC5522;
					        font-size: 14px;
					        font-weight: bold;
					        overflow: hidden;
					        padding-right: 13px;
					        white-space: nowrap;
					    }

					    .iw_poi_content {
					        font: 12px arial,sans-serif;
					        overflow: visible;
					        padding-top: 4px;
					        white-space: -moz-pre-wrap;
					        word-wrap: break-word;
					    }
					</style><script type="text/javascript" src="http://api.map.baidu.com/api?key=&v=1.1&services=true"></script>
<div style="border-bottom: #ccc 1px solid; border-left: #ccc 1px solid; width: 650px; height: 450px; border-top: #ccc 1px solid; border-right: #ccc 1px solid" id="dituContent">&nbsp;</div>
<script type="text/javascript">

    function initMap() {
        createMap();
        setMapEvent();
        addMapControl();
        addMarker();
    }


    function createMap() {
        var map = new BMap.Map("dituContent");
        var point = new BMap.Point(114.24928019007, 22.296399884584);
        map.centerAndZoom(point, 18);
        window.map = map;
    }


    function setMapEvent() {
        map.enableDragging();
        map.enableScrollWheelZoom();
        map.enableDoubleClickZoom();
        map.enableKeyboard();
    }


    function addMapControl() {

        var ctrl_nav = new BMap.NavigationControl({ anchor: BMAP_ANCHOR_TOP_LEFT, type: BMAP_NAVIGATION_CONTROL_LARGE });
        map.addControl(ctrl_nav);

        var ctrl_ove = new BMap.OverviewMapControl({ anchor: BMAP_ANCHOR_BOTTOM_RIGHT, isOpen: 1 });
        map.addControl(ctrl_ove);

        var ctrl_sca = new BMap.ScaleControl({ anchor: BMAP_ANCHOR_BOTTOM_LEFT });
        map.addControl(ctrl_sca);
    }


    var markerArr = [{ title: "香港大田机械有限公司", content: "香港九龙油塘崇信街2号油塘工业大厦第一座9楼B室", point: "114.24928019007|22.296399884584", isOpen: 1, icon: { w: 21, h: 21, l: 0, t: 0, x: 6, lb: 5 } }
    ];
    //marker
    function addMarker() {
        for (var i = 0; i < markerArr.length; i++) {
            var json = markerArr[i];
            var p0 = json.point.split("|")[0];
            var p1 = json.point.split("|")[1];
            var point = new BMap.Point(p0, p1);
            var iconImg = createIcon(json.icon);
            var marker = new BMap.Marker(point, { icon: iconImg });
            var iw = createInfoWindow(i);
            var label = new BMap.Label(json.title, { "offset": new BMap.Size(json.icon.lb - json.icon.x + 10, -20) });
            marker.setLabel(label);
            map.addOverlay(marker);
            label.setStyle({
                borderColor: "#808080",
                color: "#333",
                cursor: "pointer"
            });

            (function () {
                var index = i;
                var _iw = createInfoWindow(i);
                var _marker = marker;
                _marker.addEventListener("click", function () {
                    this.openInfoWindow(_iw);
                });
                _iw.addEventListener("open", function () {
                    _marker.getLabel().hide();
                })
                _iw.addEventListener("close", function () {
                    _marker.getLabel().show();
                })
                label.addEventListener("click", function () {
                    _marker.openInfoWindow(_iw);
                })
                if (!!json.isOpen) {
                    label.hide();
                    _marker.openInfoWindow(_iw);
                }
            })()
        }
    }
    //InfoWindow
    function createInfoWindow(i) {
        var json = markerArr[i];
        var iw = new BMap.InfoWindow("<b class='iw_poi_title' title='" + json.title + "'>" + json.title + "</b><div class='iw_poi_content'>" + json.content + "</div>");
        return iw;
    }

    function createIcon(json) {
        var icon = new BMap.Icon("http://app.baidu.com/map/images/us_mk_icon.png", new BMap.Size(json.w, json.h), { imageOffset: new BMap.Size(-json.l, -json.t), infoWindowOffset: new BMap.Size(json.lb + 5, 1), offset: new BMap.Size(json.x, json.h) })
        return icon;
    }

    initMap();
</script>
					
					<div class="cl">&nbsp;</div>
				</section>

			</div>
			<!-- end of main -->
		</div>
		<!-- end of shell -->	
		#{bottom}
	</div>
	<!-- end of wrapper -->
</body>
</html>